﻿namespace MemoryTest_Communications.PropertySearch.Resources
{
    using System.Xml.Serialization;
    using Newtonsoft.Json;

    [JsonObject(MemberSerialization.OptIn)]
    [XmlTypeAttribute(TypeName = "location")]
    public sealed class Location
    {
        public Location(){}

        [JsonProperty("center_lat")]
        [JsonConverter(typeof(EmptyStringToNullableDecimalConverter))]
        [XmlAttribute(AttributeName = "center_lat", Type = typeof(decimal))]
        public decimal? CentreLatitude { get; set; }

        [JsonProperty("center_long")]
        [JsonConverter(typeof(EmptyStringToNullableDecimalConverter))]
        [XmlAttribute(AttributeName = "center_long", Type = typeof(decimal))]
        public decimal? CentreLongitude { get; set; }

        [JsonProperty("long_title")]
        [XmlAttribute(AttributeName = "long_title", Type = typeof(string))]
        public string LongTitle { get; set; }

        [JsonProperty("place_name")]
        [XmlAttribute(AttributeName = "place_name", Type = typeof(string))]
        public string PlaceName { get; set; }

        [JsonProperty("title")]
        [XmlAttribute(AttributeName = "title", Type = typeof(string))]
        public string Title { get; set; }
    }

}
